Add Users
2015/11/25 |
[1] | Add a new user account. |
localhost:~ # useradd -m suse localhost:~ # passwd suse New password: # set password Retype new password: # confirm passwd: password updated successfully localhost:~ # # logout |
[2] | Try to switch from a user that was added above to root account. |
localhost login: suse # input user name password: # password suse@localhost:~> su - # switch to root Password: # root password localhost:~ # # just switched to root |
[3] | Limit users who can execute su commmand. Th example below limits only "root" and "suse". |
localhost:~ # usermod -G wheel root localhost:~ # usermod -G wheel suse
localhost:~ #
vi /etc/pam.d/su # line 2: add auth required pam_wheel.so
localhost:~ #
vi /etc/pam.d/su-l # line 2: add auth required pam_wheel.so |